package com.gg.cart.contorller;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;

import com.gg.cart.service.CartService;

import helpers.baseservlet.BaseServlet;
import povos.CartFruitPovo;


@WebServlet("/cart/SearchAllCartsServlet")
public class SearchAllCartsServlet extends BaseServlet {
	@Autowired
	private CartService cartService;
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String uid=request.getParameter("uid");
		List<CartFruitPovo> povos=cartService.getCartFruitPovoByUid(uid);
		request.getSession().setAttribute("cartpovos", povos);
		response.sendRedirect("/fruits/showcart.jsp");
		
	}

	

}
